package cn.ac.iscas.service.softwareCopyright;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.ac.iscas.bean.base.DAOSupport;
import cn.ac.iscas.bean.base.DeleteDocument;
import cn.ac.iscas.bean.patent.PatentPicture;
import cn.ac.iscas.bean.softwareCopyright.SoftwarePicture;
@Service
@Transactional
public class SoftwarePictureServiceImp extends DAOSupport<SoftwarePicture>
		implements ISoftwarePictureService {

	/* (non-Javadoc)
	 * @see cn.ac.iscas.bean.base.DAOSupport#delete(java.lang.Object)
	 */
	@Override
	public void delete(Object entity) {
		SoftwarePicture picture = (SoftwarePicture)entity;
		DeleteDocument.deleteDocuments(picture.getRealName());
		System.out.println(picture.getId());
		picture = (SoftwarePicture)sessionFactory.getCurrentSession().get(SoftwarePicture.class, picture.getId());
		sessionFactory.getCurrentSession().delete(picture);
	}
	
}
